package com.cium.aqie.dataType

/**
 * @Function:
 * @Author: aqie
 * @Date: 2019/8/27 9:45
 */
val string: String = "HelloWorld"
// 字符数组 转 字符串
val fromChars: String = String(charArrayOf('H', 'e','l','l','o','W','o','r','l','d'))

fun main(args: Array<String>) {
    // 完全等价于 equals
    println(string == fromChars)
    // 类似java ==
    println(string === fromChars)

    println("接下来我们要输出:" + string)

    val arg1: Int = 0
    val arg2: Int = 1
    println("" + arg1 + " + " + arg2 + " = " + (arg1 + arg2))
    // 字符串模板
    println("$arg1 + $arg2 = ${arg1 + arg2}")

    //Hello "Trump"
    val sayHello : String = "Hello \"Trump\""
    println(sayHello)
    //salary
    val salary: Int = 1000
    //$salary
    println("$salary\$")

    // 原始字符串($salary 始终无法转义)
    val rawString: String = """
        \t
        \n
\\\\\\$$$ salary
    """
    println(rawString)
    println(rawString.length)
}